package com.meusconcursos.dataupdate.tables;

import com.meusconcursos.MeusConcursosActivity;
import com.meusconcursos.dataupdate.Record;
import com.meusconcursos.dataupdate.Table;

import android.content.ContentValues;
import android.util.Log;

public class TablePlanoEstudo extends Table {

	public TablePlanoEstudo() {
		super();

	}

	@Override
	public String getTableName() {
		return "planoestudo";
	}

	@Override
	public String getScriptTableCreate() {
		return getHeaderScriptTableCreate()
				+ "([_id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "
				+ "[id_formacao] INTEGER NOT NULL, "
				+ "[total_previsto] INTEGER DEFAULT 0, "
				+ "[total_realizado] INTEGER DEFAULT 0) ";
	}

	@Override
	public Record newRecordInstance(String[] values) {

		ContentValues cv = null;

		cv = new ContentValues();
		int indiceValue = 0;

		cv.put("id_formacao", new Integer(values[indiceValue++]));
		
		Log.i(MeusConcursosActivity.DEBUG_TAG, "Criando Registro PLANOESTUDO: " + cv.toString());		

		return new Record(cv);

	}

}
